Package-level declarations

Types

Link copied to clipboard
interface ShadowCaster

Implemented by earth.worldwind.draw.Drawables that can be rendered into the cascaded shadow map's depth pass. Parallel to earth.worldwind.draw.SightlineOccluder but specialized for the directional sun-shadow pipeline: the depth-pass program is the same depth-only shader used by the sightline pipeline, but the per-cascade matrices come from DrawableShadow (orthographic) instead of from a perspective sightline frustum.

Link copied to clipboard

Adds directional sun-shadow rendering to the scene. When this layer is in the layer list, shapes (3D meshes, polygons, COLLADA / glTF models, OGC 3D-Tile meshes, etc.) cast shadows onto terrain and onto each other from the same world-space sun direction that drives shape lighting and atmospheric scattering (RenderContext.lightDirection).

Link copied to clipboard

Per-shape opt-in for cascaded sun-shadow participation. One enum value selects whether a renderable casts, receives, both, or neither. Decoupled from ShapeAttributes.isLightingEnabled (which controls Lambertian shading only) so cast and receive can be configured independently of shading.

Link copied to clipboard

Reusable GLSL fragments concatenated into every shadow receiver's fragment shader.

Link copied to clipboard

Common contract implemented by every shader program that samples the cascaded shadow maps (see ShadowReceiverGlsl for the GLSL these methods drive). Lets applyShadowReceiverUniforms bind cascade depth textures and load the per-frame cascade matrices in one place rather than copy-pasting the recipe into every receiver drawable.

Link copied to clipboard
class ShadowReceiverUniforms(enabled: Boolean, depthBiasMeters: Float = ShadowReceiverGlsl.PRIMITIVE_DEPTH_BIAS_METERS)

The GL uniform-location + upload machinery every ShadowReceiverProgram needs, factored out of the receiver programs (triangle / basic-texture / surface-texture / 3D-Tiles mesh + points) that would each copy-paste the identical field block, init resolution loop, and loadEnabled/loadDisabled bodies. A program owns one instance, resolves it in initProgram, and forwards its interface methods to it (see ShadowReceiverProgram).

Link copied to clipboard

View-depth extent of shadow-relevant scene content, accumulated from drawable bounding spheres as they are offered and consumed by ShadowLayer on the next frame (the shadow layer renders before content layers). Fitting cascades to actual content — instead of a terrain-ray probe — is what keeps street-level views at centimetre texels.

Link copied to clipboard
class ShadowState(val cascadeCount: Int = DEFAULT_CASCADE_COUNT)

Per-frame state for the directional sun-shadow pipeline. Owned by ShadowLayer, populated during render, and consumed by earth.worldwind.draw.DrawableShadow (depth pass) and by receiver shaders (terrain, lit shapes, 3D-Tile meshes) during the main pass.

Functions

Link copied to clipboard

Binds the per-frame cascade depth textures to texture units 1..4 and pushes the cascade uniforms into program — or, when no shadow state is available (no earth.worldwind.layer.shadow.ShadowLayer this frame, or pick mode, or the platform can't run the depth-texture cascade pipeline, or the caller passes applyShadow = false), calls ShadowReceiverProgram.loadShadowDisabled so the receiver shader's applyShadow branch elides the lookup. Active texture unit is restored to GL_TEXTURE0 on the way out so subsequent texture binds in the caller's draw method land on the surface texture as expected.